using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class InteractiveArea : MonoBehaviour
{
    [HideInInspector]
    public List<Collider2D> Colliders;
    public void Init()
    {
        Colliders = new List<Collider2D>();
        int count = transform.childCount;
        for (int i = 0; i < count; i++)
        {
            Colliders.AddRange(transform.GetChild(i).GetComponents<Collider2D>());
        }
    }

    public void SetTrigger(bool flag)
    {
        foreach (var collider in Colliders)
        {
            collider.isTrigger = flag;
        }
    }
}
